<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="title">
        #{bundle.Register}
    </ui:define>

    <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="4">
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{personsController.selected.firstName}" title="#{bundle.CreatePersonsTitle_firstName}" />
                   
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{personsController.selected.lastName}" title="#{bundle.CreatePersonsTitle_lastName}" />
                  
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_email}" for="email" />
                    <h:inputText id="email" value="#{personsController.selected.email}" title="#{bundle.CreatePersonsTitle_email}" />
                   
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_phoneNumber}" for="phoneNumber" />
                    <h:inputText id="phoneNumber" value="#{personsController.selected.phoneNumber}" title="#{bundle.CreatePersonsTitle_phoneNumber}" />
                    
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_login}" for="login" />
                    <h:inputText id="login" value="#{personsController.selected.login}" title="#{bundle.CreatePersonsTitle_login}" 
                                 required="true" label="#{bundle.CreatePersonsTitle_login}"/>

                    <h:outputLabel value="#{bundle.CreatePersonsLabel_address}" for="address" />
                    <h:inputText id="address" value="#{personsController.selected.address}" title="#{bundle.CreatePersonsTitle_address}" />
                    
                    <h:outputLabel value="#{bundle.CreateuserLabel_password}" for="password" />
                    <h:inputSecret id="password" value="#{personsController.selected.password}" 
                                   title="#{bundle.CreateuserTitle_password}" required="true" 
                                   binding="#{passwordComponent}" label="#{bundle.CreateuserTitle_password}"/>
                    
                    <h:outputLabel value="#{bundle.CreatePersonsLabel_street}" for="street" />
                    <h:inputText id="street" value="#{personsController.selected.street}" title="#{bundle.CreatePersonsTitle_street}" />
                  
                    <h:outputLabel value="#{bundle.CreateuserLabel_password_repeat}" for="passwordRepeat" />
                    <h:inputSecret id="passwordRepeat" title="#{bundle.CreateuserTitle_password_repeat}" 
                                   required="true" 
                                   label="#{bundle.CreateuserTitle_password} #{bundle.CreateuserTitle_password_repeat}">
                        <f:validator validatorId="passwordRepeat" />
                         <f:attribute name="passwordComponent" value="#{passwordComponent}" />
                    </h:inputSecret>
                    
                    Captcha:
                    <p:captcha id="captcha"
                        required="true"
                        requiredMessage="Captcha entries required"
                        validatorMessage=
                        "Text does not match. Try again."/>
                    
                </h:panelGrid>
                <br />
                <h:commandLink action="#{personsController.register}" value="#{bundle.CreatePersonsSaveLink}"/>
            </h:form>
        </ui:define>

</ui:composition>
